<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="parent">
    <div class="son"></div>
</div>
</body>

</html>
<style>
    /*.parent {*/
    /*    display: flex;*/
    /*    align-content: center;*/
    /*    background-color: gold;*/
    /*    height: 300px;*/
    /*    width: 300px;*/
    /*    position: fixed;*/
    /*}*/

    /*.son {*/
    /*    background-color: tomato;*/
    /*    height: 100px;*/
    /*    width: 100px;*/
    /*    !*position: relative;*!*/
    /*    position: relative;*/
    /*    top: 50%;*/
    /*    left: 50%;*/
    /*    transform: translate(-50%,-50%);*/
    /*}*/

    .parent {
        height: 300px;
        width: 300px;
        background-color: gold;
        justify-content: center;
        display: flex;
        align-items: center;
    }
    .son {
        position: absolute;
        background-color: tomato;
        height: 100px;
        width: 100px;
    }

    /*.parent {*/
    /*    height: 300px;*/
    /*    width: 300px;*/
    /*    background-color: gold;*/
    /*    position: relative;*/
    /*}*/

    /*.son {*/
    /*    background-color: tomato;*/
    /*    height: 100px;*/
    /*    width: 100px;*/
    /*    position: absolute;*/
    /*    top: 0;*/
    /*    left: 0;*/
    /*    right: 0;*/
    /*    bottom: 0;*/
    /*    margin: auto;*/
    /*}*/
</style>